## Replication code for Estimating Candidates’ Political Orientation in a Polarized Congress

This file shows how to replicate each of the empirical tables and figures in our paper.

Set the working directory in R to whatever directory you downloaded the replication materials from our paper.

The R files shown below that replicate Tables 2-9 all export text files with the LaTex code necessary to replicate the tables in the paper.

Table 2: Run Tables2-3.r
Table 3: Run Tables2-3.r
Table 4: Run Tables4-7.r (this file uses RollCall_Analysis_PCP_APRE.R and oc.R)
Table 5: Run Tables4-7.r (this file uses RollCall_Analysis_PCP_APRE.R and oc.R)
Table 6: Run Tables4-7.r (this file uses RollCall_Analysis_PCP_APRE.R and oc.R)
Table 7: Run Tables4-7.r (this file uses RollCall_Analysis_PCP_APRE.R and oc.R)
Table 8: Run Tables8-9.r
Table 9: Run Tables8-9.r

These files all export PDF files of the figures in the paper.
Figure 1: Run Figures1-2.R
Figure 2: Run Figures1-2.R
Figure 3: Run Figure3.R

In order to run properly, these R files require the following data files from the Dataverse  (make sure you download each in RData format):
candidatepositions_house_analysis.RData
candidatepositions_senate_analysis.RData
house_rollcalls.RData
OptimalClassification_results.RData
senate_rollcalls.RData
ordfiles.RData

